class Person:
    # name = "张三"
    # age = 21
    # gender = "男"

    def __init__(self,name,age,gender):  # self指当前对象的实例
        self.name = name
        self.age = age
        self.gender = gender
        print("==========调用构造方法创建对象{}==========".format(self.name))
    # def setName(self,name):
    #     self.name = name
    # def setAge(self,age):
    #     self.age = age
    # def setGender(self,gender):
    #     self.gender = gender

    def eat(self):
        print("人要吃饭。。")
    def sleep(self):
        print("人要睡觉")
    def toString(self):
        print("我叫{},今年{}岁了，我是{}孩子".format(self.name,self.age,self.gender))

    def __del__(self):
        print("-----调用析构方法删除当前对象{}------".format(self.name))